package day20170418.date;

import java.util.Date;

import org.junit.Test;

public class DateTest {
	@Test
	public void dateTest() throws Exception {
		Date date = new Date();
		System.out.println("从1900年到现在的年份"+date.getYear());
		System.out.println("拿到月份"+date.getMonth());
		System.out.println("拿到日期"+date.getDay());
		System.out.println("拿到几点"+date.getHours());
		System.out.println("拿到分钟"+date.getMinutes());
		System.out.println("拿到秒"+date.getSeconds());
		Date date2 = new Date(2017);
		System.out.println(date2);
	}
}
